package RPS;

import java.util.ArrayList;
import java.util.Random;

public class Player {
	private String name;
	private int score;
	private ArrayList<RPSEnum> moves;
	private int index;
	
	public Player(String n,ArrayList<RPSEnum> list){
		this.name=n;
		this.moves=list;
		this.index=-1;
		this.score=0;
	}
	
	public Player(String n){
		this.name=n;
		this.moves=new ArrayList<RPSEnum>();
		Random r=new Random();
		for(int i=0;i<10;i++){
			switch(r.nextInt(3)){
				case 0:
					this.moves.add(RPSEnum.ROCK);break;
				case 1:
					this.moves.add(RPSEnum.PAPER);break;
				case 2:
					this.moves.add(RPSEnum.SCISSORS);break;
			}
		}
		this.index=-1;
		this.score=0;
	}

	public String getName() {
		return name;
	}

	public int getScore() {
		return score;
	}
	
	public void setScore(int score) {
		this.score = score;
	}

	public int getNbMoves() {
		return this.moves.size();
	}
	
	public RPSEnum getNextMoves() {
		this.index++;
		return this.moves.get(this.index);
	}
}
